package pers.flowerinsnow.minecraft.forge.fastdungeonjoiner.util

import scala.util.control.Breaks
import scala.util.control.Breaks.breakable

object MessageUtils {
  def parseColor(s : String): String ={
    s.replace("&" ,"§")
      .replace("§§", "&")
  }
  def removeColor(s : String): String={
    val sb = new StringBuilder(s)
    var index : Int = 0
    breakable {
      while (true) {
        index = sb.indexOf("§")
        if (index == -1) Breaks.break()
        sb.delete(index, index + 2)
      }
    }
    sb.toString()
  }
}
